home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
DATAUTIL
/
DBASEUT1.LZH
/
STEPBACK.PRG
< prev
next >
Wrap
Text File
|
1989-01-07
|
5KB
|
176 lines
********************************************************************************
* T3SB.PRG <-FILE
* STEP BACKWARD <-FUNCTION
*
* (c) 1989 TECH III, INC. @ (213) 547-2191
*
* HISTORY: 1/07/89 1:50 pm Richard Grossman
*******************************************************************************
* SET ENVIRONMENT
set talk off
set status off
set safety off
set scoreboard off
set deleted off
close all
clear all
clear
@ 23,00 say 'STEP BACKWARD Program is initializing...'
if iscolor()
store 'B/W, W/B+' to color1
store 'GR+/N,W+*/R' to color2
store 'RB/N+,N/RB' to color3
store 'W+/N,N/W' to color4
else
store 'W+/N,N/W' to color1, color4
store 'N/W,W+/N' to color2, color3
endif
* MAKE SURE YOU'RE RUNNING IN DBASE IV
on error do COPOUT with 'Sorry, this program only works in dBASE IV.'
set clock off
on error
* DEFINE WINDOWS
define window SIGN_OFF from 05,10 to 09,70 double color &COLOR4
define window PROPGAND from 00,00 to 24,79 color &COLOR1
define window GET_OKAY from 04,04 to 22,76 double color &COLOR2
define window WATCH_IT from 07,07 to 18,72 double color &COLOR3
* OPENING PROPAGANDA WINDOW
activate window PROPGAND
@ 01,02 say 'STEP BACKWARD Copyright (c) 1989 Tech III, Inc.'
@ 00,00 to 02,77 double
text
The bold utility for those who want to take a step forward into the future
with dBASE IV while keeping one foot safely in the past with dBASE III Plus,
and other dBASE III Plus file-format-using programs.
If you like this program, you'll love our custom programming services, and
our other products, such as:
SCAN-A-LYZER! The fastest dBase documentor
SIMPLICITY The best-value library for Clipper (soon: the dBase compiler)
W.E.M.P. Let's us word-star interface addicts use Brief
For more info, please call Tech III:
US TOLL-FREE: 800 543-9941 CAL & WORLD: 213 547-2191 FAX: 213 547-2758
COMPUSERVE: Richard Grossman 76137,2514 MCI-MAIL: TECHIII
endtext
wait
@ 20,00 clear
* WARNING MESSAGE AND CHANCE TO CANCEL
activate window GET_OKAY
text
This program will utilize the dBASE IV command: COPY TO fname TYPE
dbmemo3 to return any dbase files that have memo fields back to their
virgin dBASE III Plus-compatible state. If you don't know what this
means or what it's good for, you probably don't need it.
It only processes files with associated DBT files. It does ALL of
those. When I get the time, I'll write a pop-up routine to let you
pick files.
Okay, here's your chance to chicken out: if this program scrambles
your files, your brain, your job, your data, your disk, etc., you're
on the hook all by yourself. By answering Yes to the next prompt you
agree to this. (Say, do you have a back-up around?) It works great
for me.
endtext
store .N. to AGREE
?
@ row(),03 say 'AGREE TO THE ABOVE AND START PROCESSING?' get AGREE pict 'Y'
read
if .not. AGREE
do SIGN_OFF with 'Thanks for using STEP BACKWARD.'
return
endif
* OKAY, HERE WE GO...
deactivate window GET_OKAY
activate window WATCH_IT
? 'Processing started... If you can figure out the workaround for'
? 'the dBASE IV anomaly that produces the "Press any key" message '
? 'that is about to mess up my screen, please let me know!'
?
? 'Running a DIR on the databases in DOS...'
run dir *.DB? > DB.TXT
clear
? 'Building a database of dbf and dbt files...'
use STEPBACK in 1 alias DATA_FILES
select DATA_FILES
zap
copy structure to STEPBK2
set talk on
append from DB.TXT sdf for FILE_EXT = 'DBF'
set talk off
use STEPBK2 in 2 alias MEMO_FILES
select MEMO_FILES
append from DB.TXT sdf for FILE_EXT = 'DBT'
index on FILE_NAME to STEPBK2
select DATA_FILES
set relation to FILE_NAME into MEMO_FILES
go top
locate for .not. eof("MEMO_FILES")
store 0 to counter
do while .not. eof("DATA_FILES")
store counter + 1 to counter
? 'Processing ' + trim(FILE_NAME)
store trim(FILE_NAME) to MFILE_NAME
use (MFILE_NAME) in 3 alias WORKFILE
select WORKFILE
set talk on
copy to TEMP
set talk off
use TEMP
set talk on
copy to (MFILE_NAME) type dbmemo3
set talk off
select DATA_FILES
continue
enddo
* Housekeeping
? 'Housekeeping (deleting work files)...'
zap
close data
erase STEPBK2.DBF
erase STEPBK2.NDX
erase DB.TXT
if file('TEMP.DBF')
erase TEMP.DBF
endif
if file('TEMP.DBT')
erase TEMP.DBT
endif
do SIGN_OFF with ltrim(str(counter,5)) + ' files processed. Thanks for using STEP BACKWARD'
return
procedure SIGN_OFF
parameters MSG
activate window SIGN_OFF
clear
@ 01,01 say MSG
?
wait ' (Next keystroke dumps you back to the prompt)'
close all
clear all
deactivate window all
set color to R+/N
clear
@ 01,00 say '...STEP BACKWARD. Copyright 1989 (c) Tech III, Inc.'
set color to W+/N, N/W
return
procedure COPOUT
parameters MSG
@ 23,00 say MSG
return
* EOF